Enable .mjs static file fallback in all environments#84
Merged
antosubash merged 4 commits intomainfrom Apr 5, 2026
Merged
Conversation
ASP.NET Identity defaults the login redirect to /Account/Login, but the Users module's ViewPrefix is /Identity/Account, placing the actual login route at /Identity/Account/Login. This mismatch caused unauthenticated requests to redirect to a 404 page. Explicitly sets LoginPath, LogoutPath, and AccessDeniedPath on the application cookie to match the module's ViewPrefix.
The UseStaticFiles fallback for .mjs chunks was gated behind IsDevelopment(), but MapStaticAssets can miss .mjs files when the Docker image's static asset manifest is stale. This caused 404s for Users module page chunks in production while other modules worked. Removing the environment gate ensures .mjs files in wwwroot are always served even if MapStaticAssets doesn't know about them.
Deploying simplemodule-website with
|
| Latest commit: |
ae95ad0
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://8502fa4f.simplemodule-website.pages.dev |
| Branch Preview URL: | https://claude-fix-docker-auth-1x4e4.simplemodule-website.pages.dev |
When a module's page chunk fails to load (404, network error, missing page registry entry), the user previously saw nothing — the page just stayed blank. Now shows a toast: "Failed to load page X. Try refreshing the page."
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
UseStaticFilesfallback for.mjschunks was gated behindIsDevelopment(), causing 404s for Users module page chunks in the deployed Docker app while other modules worked fineMapStaticAssets()builds a manifest at publish time, but when the deployed image has a stale manifest (Docker layer caching, etc.),.mjschunks not in the manifest get 404s with no fallback in production.mjsfiles inwwwrootare always served, even ifMapStaticAssetsdoesn't know about themRoot cause
Clicking "Log in" on the deployed site at
app.simplemodule.devdid nothing because:pages.jsentry loaded fine (it's in the static assets manifest).mjschunk (Login-CyRO3Y-E.mjs) returned 404Test plan
/Identity/Account/Loginpage renders correctly.mjschunks load (not justpages.jsentries)